package geektime.spring.springbucks;

import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import geektime.spring.springbucks.service.CoffeeService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Slf4j
@EnableTransactionManagement
@SpringBootApplication
@MapperScan("geektime.spring.springbucks.mapper")
@EnableApolloConfig
public class SpringBucksApplication implements ApplicationRunner {
	@Autowired
	private CoffeeService coffeeService;
	@Value("${timeout:''}")
	private String  timeout;

	@Value("${jkLearningTest:''}")
	private String  jkLearningTest;

	@Value("${jkLearning.home.work:''}")
	private String  jkLearningStr;

	public static void main(String[] args) {
		SpringApplication.run(SpringBucksApplication.class, args);
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
		log.info("获取apollo配置内容:jkLearningTest:{},jkLearning.home.work:{}",jkLearningTest,jkLearningStr);
	}



}

